By bus or marshrutka
Buses and marshrutkas depart from Shamakhinka bus station in Baku every hour starting at 8AM. Buses and marshrutkas are a comfortable option, but take longer than taxis. The trip from Baku to Khachmaz takes 3 hours via bus and costs 3 AZN. The marshrutkas or minibuses usually depart every half an hour starting at 8 in the morning. It takes 2.5-3 hours to get to Khachmaz.
By taxi
The fastest transport between Baku and Khachmaz is by taxi. It takes two 2 hours. Prices must be negotiated, but going via Lada from Baku to Khachmaz costs 4-5 AZN per seat 4 persons and going via by Mercedes costs 5 AZN per seat. To take a cab by yourself, expect to pay around 20 AZN.
By train
There is an electric train service that runs between Baku and Khachmaz. The price of the ticket is 0.60 qepik coins. The train leaves Baku at 8AM. An evening electric train leaves Baku at 7:20 PM.
The electric train ride is for the adventurer. The cars are packed with people especially with the current road construction anticipated to last until 2010. Khanims ladies from the bazaar tend to take up seating space to stretch their legs or with their baggage. Don't be surprised if you have to argue for a seat or stand for a portion of the 4:45 minute ride from Baku to Khachmaz. The seats are wooden benches and aren't especially clean; the isles are crammed with cargo from fruit sellers; and the patrons can get loud during arguments over space.
The night train Baku-Yalama costs 0.60 qepik and leaves Baku at 8PM.